package libnetdb.dm.assoc.util;

/**
 * The listener interface for receiving controller events (state change, stage change,
 * progress change, and stage progress change) on a controller.
 *
 * @author Cheng-Ru Lin
 * @version 1.0 2002/8
 */
public interface ProgressListener {
    /**
     * Invoked when the state of the task which is controlled
     * by the controller "who" changes.
     *
     * @param who the contoller which issue the event
     */
    public void taskPaused(ControllableTask who);

    /**
     * Invoked when the state of the task which is controlled
     * by the controller "who" changes.
     *
     * @param who the contoller which issue the event
     */
    public void taskResumed(ControllableTask who);

    /**
     * Invoked when the controllable task has post a new message.
     *
     * @param who the task who send this message
     * @param message the message
     */
    public void messagePosted(ControllableTask who, String message);

    /**
     * Invoked when the stage of the task which is controlled
     * by the controller "who" changes.
     *
     * @param who the contoller which issue the event
     * @param stage the current stage of the controlled task
     * @see ControllableTask#getStage()
     */
    public void stageChanged(ControllableTask who, String stage);

    /**
     * Invoked when the progress of the task which is controlled
     * by the controller "who" changes.
     *
     * @param who the contoller which issue the event
     * @param progress the current progress of the controlled task
     * @see ControllableTask#getProgress()
     */
    public void progressChanged(ControllableTask who, float progress);

    /**
     * Invoked when the progress of current stage of the task which
     * is controlled by the controller "who" changes.
     *
     * @param who the contoller which issue the event
     * @param progress the progress of the current stage of the controlled task
     * @see ControllableTask#getStageProgress()
     */
    public void stageProgressChanged(ControllableTask who, float progress);
}
